package com.my.study.redisson.model;

import java.io.Serializable;
import java.util.Objects;

/**
 * 消息
 *
 * @author: yidujun
 * @create: 2021/11/08 16:17
 */
public class Message implements Serializable {
    private static final long serialVersionUID = -9094531122471628116L;

    private String msg;

    private ClientInfo clientInfo;

    public Message() {
    }

    public Message(String msg) {
        this.msg = msg;
    }

    public Message(String msg, ClientInfo clientInfo) {
        this.msg = msg;
        this.clientInfo = clientInfo;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public ClientInfo getClientInfo() {
        return clientInfo;
    }

    public void setClientInfo(ClientInfo clientInfo) {
        this.clientInfo = clientInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Message message = (Message) o;
        return Objects.equals(msg, message.msg) &&
                Objects.equals(clientInfo, message.clientInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(msg, clientInfo);
    }

    @Override
    public String toString() {
        return "Message{" +
                "msg='" + msg + '\'' +
                ", clientInfo=" + clientInfo +
                '}';
    }
}
